<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ include file="/jsp/common/common.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/default/easyui.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/icon.css"/>">
<link rel="Stylesheet" type="text/css"
	href="<c:url value="/static/css/jquery.ui.css"/>" />
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery-1.6.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.panel.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.datagrid.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.messager.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/ext-for-framework.js.jsp"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/locale/easyui-lang-zh_CN.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/js/showMsg.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/listBox/jquery.clever.listbox.js"/>"></script>
<script>
	var Addressturnover;
	$.ajax({
		async : false,
		url : "<c:url value='/turnover/turnoverTypePullDown.do?space=0'/>",
		type : "post",
		data : {
			materType : 1
		},
		success : function(data) {
			Addressturnover = data;
			if (typeof (Addressturnover) == 'string') {
				Addressturnover = JSON.parse(Addressturnover);
			}
		}
	});
	//设置种类
    function formatturnoverType(value, row, index, field) {
        for (var i = 0; i < Addressturnover.length; i++) {
            if (value == Addressturnover[i].turnoverType) {
                return Addressturnover[i].turnoverTypeName;
            }
        }
        return "无";
    }
	function initList(listDisplayEId) {
		$('#' + listDisplayEId).datagrid(
				{
					url : "<c:url value="/turnover/turnoverDetailForManager.do"/>"
							+ "?turnoverDateStart="
							+ "${FinancingManagerVo.dateStart }"
							+ "&turnoverDateEnd=" + "${FinancingManagerVo.dateEnd }"
							+ "&custId=" + "${FinancingManagerVo.custId }",
					nowrap : false,
					striped : true,
					collapsible : true,
					remoteSort : true,
					notSelectByRow : false,
					onLoadError : function() {
						$.messager.alert('错误', '获取数据失败，请与管理员联系！', 'error');
					}
				});
	};
	$(document).ready(function() {
		initList('listDisplay');
	});
	//导出报表
	function excel() {
		$('#searchForm').form('submit', {
			url : '<c:url value='/check/exportCheckExcelDetail.do'/>', //查询提交路径
			onSubmit : function()//提交按钮相应函数
			{
				return $('#searchForm').form('validate');
			},
			success : function(data) {
				data = eval("(" + data + ")");
				if (data.success) {
					$.messager.alert("提示", "导出成功！", 'info', function() {
						window.close();
					});
				} else {
					$.messager.alert("提示", data.msg, 'warning');
				}
			},
			error : function() {
				$.messager.alert("错误", "系统错误，请联系管理员！", 'error');
				return;
			}
		});
	}
</script>
</head>
<body>
	<table width="98%">
		<tr>
			<td>
				<div
					style="height: auto; width: 100%; background: #fafafa; padding: 5px;"
					class="easyui-panel" title="主页检索条件" iconCls="icon-search"
					collapsible="true" minimizable="false" maximizable="false"
					closable="false">
					<form id="searchForm" name="searchForm" method="post">
						<div>
							<table cellpadding="5">
								<tr>
									<td>起始日期</td>
									<td><input class="easyui-validatebox" readOnly="true"
										editable="false" id="ordDateStart" name="ordDateStart"
										value="${FinancingManagerVo.dateStart }"></input></td>
									<td>截止日期</td>
									<td><input class="easyui-validatebox" readOnly="true"
										editable="false" id="ordDateEnd" name="ordDateEnd"
										value="${FinancingManagerVo.dateEnd }"></input></td>
								</tr>
								<tr>
									<td>客户</td>
									<td colspan="3"><input style="width: 355px"
										readOnly="true" id="custName" name="custName"
										value="${FinancingManagerVo.custName }"></input></td>

								</tr>
								<input class="easyui-validatebox" readOnly="true"
									editable="false" id="custId" name="custId"
									value="${FinancingManagerVo.custId }" type="hidden"></input>
							</table>
						</div>
					</form>
				</div>
			</td>
		</tr>
	</table>
	<table width="98%">
		<tr>
			<td>
				<table id="listDisplay" title="营业额列表" iconCls="icon-list"
					singleSelect="false" idField="turnoverType" loadMsg="请稍候......"
					pagination="true" pageSize="10" pageList="[10,20,30,40,50,100]"
					sortName="turnoverType" rownumbers="true" sortOrder="asc"
					showFooter="true">
					<thead>
						<tr>
							<th field="turnoverType" width="80" sortable="true" editor="text" formatter="formatturnoverType">营业额类型
							</th>
							<th field="turnoverValueAll" width="80" sortable="true">总金额</th>
						</tr>
					</thead>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>